package com.hxh.learn.vo;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.hxh.learn.model.SysPermissions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @Author: hxh
 * @Date: 2023/3/7
 */
@Data
public class SysPermissionsUpdateVo {

    @NotBlank
    @ApiModelProperty(value = "权限id",required = true)
    private String permissionsId;

    @ApiModelProperty("上级")
    private Integer parentId;

    @ApiModelProperty("菜单名称")
    private String name;

    @ApiModelProperty("请求路径")
    private String path;

    @ApiModelProperty("0无效，1有效")
    private Integer status;



    public SysPermissions convert(){
        SysPermissions sysPermissions = new SysPermissions();
        sysPermissions.setPermissionsId(permissionsId);
        sysPermissions.setParentId(0);
        sysPermissions.setName(name);
        sysPermissions.setPath(path);
        sysPermissions.setStatus(1);
        sysPermissions.setCreateTime(DateUtil.current());
        return sysPermissions;


    }
}
